/*
 * @Author: nns4
 * @Date: 2020-03-25 15:21:59
 * @LastEditors: nns4
 * @FilePath: /note/js/19.数组.js
 * @Description: 
 */




function unitConvert(num) {
    let numString = num.toString()
    if (numString.length < 4) {
        return numString;
    } else if (numString.length == 4) {
        return `${numString[0]}${numString[1] == 0 ? "" : "." + numString[1]}千`;
    } else if (numString.length <=8) {
        return `${parseInt(numString/10000)}${numString[numString.length-4] == 0 ? "" : "." + numString[numString.length-4]}万`;
    }else if (numString.length<=12) {
        return `${parseInt(numString/100000000)}${numString[numString.length-8] == 0 ? "" : "." + numString[numString.length-8]}亿`;
    }
}
let aa = unitConvert(199109000);
console.log(aa)